]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Panel: sync primary hotcorner hover with Activities button
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 24 Mar 2011 14:00:24 +0000 (15:00 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 28 Mar 2011 20:15:04 +0000 (22:15 +0200)
Since the hotcorner is a reactive actor, and it is over the Activities
button, hovering on it results in a leave-event for the button.
This is not noticeable when opening the overview, as the button is
correctly prelighted, but it is when closing, if you keep the mouse
near the hot corner, as the button is kept in normal state, despite
the mouse being over it.

https://bugzilla.gnome.org/show_bug.cgi?id=645751

js/ui/main.js
js/ui/panel.js

index 603f485223cc3c854357311baea9f6189299560a..d02a22d2be1fefde5ef7893bb71e8210cb7e93a2 100644 (file)
@@ -539,7 +539,7 @@ function _relayout() {
         if (!isPrimary && !haveTopLeftCorner)
             continue;
 
-        let corner = new Panel.HotCorner();
+        let corner = new Panel.HotCorner(isPrimary ? panel.button : null);
         hotCorners.push(corner);
         corner.actor.set_position(cornerX, cornerY);
         if (isPrimary)
index 8cbceb05106eb270fe1e55385b0034e25e500e60..3ec9a3b4fb5ee48d1adef3b8411108327837c19b 100644 (file)
@@ -622,12 +622,17 @@ PanelCorner.prototype = {
  * This class manages the "hot corner" that can toggle switching to
  * overview.
  */
-function HotCorner() {
-    this._init();
+function HotCorner(button) {
+    this._init(button);
 }
 
 HotCorner.prototype = {
-    _init : function() {
+    _init : function(button) {
+        // This is the activities button associated with this hot corner,
+        // if this is on the primary monitor (or null with the corner is
+        // on a different monitor)
+        this._button = button;
+
         // We use this flag to mark the case where the user has entered the
         // hot corner and has not left both the hot corner and a surrounding
         // guard area (the "environs"). This avoids triggering the hot corner
@@ -654,6 +659,8 @@ HotCorner.prototype = {
 
         this._activationTime = 0;
 
+        this.actor.connect('enter-event',
+                           Lang.bind(this, this._onEnvironsEntered));
         this.actor.connect('leave-event',
                            Lang.bind(this, this._onEnvironsLeft));
         // Clicking on the hot corner environs should result in the same bahavior
@@ -730,6 +737,11 @@ HotCorner.prototype = {
         this._addRipple(0.35,  1.0,   0.0,   0.3,    1,    0.0);
     },
 
+    _onEnvironsEntered : function() {
+        if (this._button)
+            this._button.hover = true;
+    },
+
     _onCornerEntered : function() {
         if (!this._entered) {
             this._entered = true;
@@ -757,6 +769,9 @@ HotCorner.prototype = {
     },
 
     _onEnvironsLeft : function(actor, event) {
+        if (this._button)
+            this._button.hover = false;
+
         if (event.get_related() != this._corner)
             this._entered = false;
         return false;